import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

import Main from "../view/Main";
import Login from  "../view/login";
import home from "../view/home";
import monitor from "../view/monitor";
import module from "../view/module";
import control from "../view/control";

export const constantRoutes = [
    {
        path: '/',
        redirect:'/login',
    },
    {
        path: '/login',
        component: Login,
    },
    {
        path: '/home',
        component: home,
    },
    {
        path: '/monitor',
        component: monitor,
    },
    {
        path: '/module',
        component: module,
    },
    {
        path: '/control',
        component: control,
    }
]

const createRouter = () => new Router({
    // mode: 'history', // require service support
    scrollBehavior: () => ({y: 0}),
    routes: constantRoutes
})

const router = createRouter()
export default router
